import instance from "../../../utils/request";
import { baseURL } from "../../../config";


//获取用户列表数据
export const _list = async (params) => {
  try {
    const res = await instance.get(baseURL + `users/all-users/${params[0]}/${params[1]}`, {
      headers: {
        "Content-Type": "application/json",

      },
    });

    return [res.data.list];
  } catch (err) {
    console.log(err);
  }
};

//修改用户密码
export const _changepwd = async (params) => {
  try {


    const res = await instance.put(baseURL + "users/user", params,{
      headers: {
        "Content-Type": "application/json",
    
      },
    });

    return 
  } catch (err) {
    console.log(err);
  }
};

//删除用户账号
export const _delete = async (params) => {
  try {

    const res = await instance.delete(baseURL + `users/user/${params}`,{
      headers: {
        "Content-Type": "application/json",

      },
    })

    return
    
  } catch (err) {
    console.log(err);
    
  }
}
